import request from '@/config/axios'


// 获取题目分页列表
export const getQuestionPage = (params: any) => {
  return request.get({ url: '/system/qa/page', params })
}

// 获取题目详情
export const getQuestionDetail = (id: number) => {
  return request.get({ url: `/system/qa/detail?id=${id}` })
}

// 新增题目
export const addQuestion = (data: any) => {
  return request.post({ url: '/system/qa/add', data })
}

// 更新题目
export const updateQuestion = (data: any) => {
  return request.post({ url: '/system/qa/update', data })
}

// 删除题目
export const deleteQuestion = (id: number) => {
  return request.post({ url: `/system/qa/delete?id=${id}` })
}

// 批量删除题目
export const batchDeleteQuestion = (ids: string) => {
  return request.post({ url: `/system/qa/batchDelete?ids=${ids}` })
}

// 导出题目
export const exportQuestion = (params: any) => {
  return request.download({ url: '/system/qa/export', params })
}

// 获取导入模板
export const downloadQuestionTemplate = () => {
  return request.download({ url: '/system/qa/download' })
}

// 获取导入URL
export const getImportUrl = () => {
  return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/system/qa/import'
}
